/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.Comunicator;

import java.util.Vector;

/**
 *
 * @author gonçalo.margalho
 */
public class Messages {
    
    Vector<Message> send = new Vector<Message>();
    Vector<Message> recieved = new Vector<Message>();

    public void addMessageToSend(Message message) {
        send.add(message);
    }

    public void addReceivedMessage(Message message) {
        recieved.add(message);
    }

    public Message getNextMessageToSend() {
        if (send.size() == 0) {
            return null;
        }
        Message m = send.get(0);
        send.remove(0);
        return m;
    }

    public Message getNextMessageToRecieve() {
        if (recieved.size() == 0) {
            return null;
        }

        Message m = recieved.get(0);
        recieved.remove(0);
        return m;
    }
}
